home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / impr_base.idb / usr / bin / psroff.z / psroff
Encoding:
Text File  |  1997-07-30  |  1.5 KB  |  64 lines

  1.  
  2. # transcript/sh/psroff.sysv
  3. # Copyright 1985,1987 Adobe Systems Incorporated. All rights reserved.
  4. # GOVERNMENT END USERS: See notice of rights in Notice file in TranScript
  5. # library directory -- probably /usr/lib/ps/Notice
  6. # RCSID: $Revision: 1.1 $
  7. #
  8. # run ditroff in an System V environment to print on a PostScript printer
  9. #
  10. # psroff - ditroff | psdit [| lp]
  11. #
  12. PATH=/bin:/usr/bin:$PATH       # Make sure we get system programs.
  13. export PATH
  14.  
  15. ditroff=troff
  16. psdit=psdit
  17. nospool= dopt= fil= spool= dit=
  18. printer=-d${LPDEST-PostScript}
  19. family=Times
  20. fontdir=/usr/lib/ps/ditroff.font
  21. while test $# != 0
  22. do    case "$1" in
  23.     -t)    nospool=1 ;;
  24.     -Tpsc)    ;;
  25.     -T*)    echo only -Tpsc is valid 1>&2 ; exit 2 ;;
  26.     -F)    if test "$#" -lt 2 ; then
  27.             echo '-F takes following font family name' 1>&2
  28.             exit 1 
  29.         fi
  30.         family=$2 ; shift ;;
  31.     -F*)    echo 'use -F familyname' 1>&2 ;
  32.         exit 1 ;;
  33.     -D)    if test "$#" -lt 2 ; then
  34.             echo '-D takes following font directory' 1>&2
  35.             exit 1 
  36.         fi
  37.         fontdir=$2 ; shift ;;
  38.     -D*)    echo 'use -D fontdirectory' 1>&2 ;
  39.         exit 1 ;;
  40.     -n*|-m|-w|-s)    spool="$spool $1" ;;
  41.     -r|-h)    spool="$spool -o$1" ;;
  42.     -d*)    printer=$1 ;;
  43.     -)    fil="$fil $1" ;;
  44.     -*)    dopt="$dopt $1" ;;
  45.     *)    fil="$fil $1" ; jobname=${jobname-$1} ;;
  46.     esac
  47.     shift
  48. done
  49. if test "$jobname" = "" ; then
  50.     jobname="Troff"
  51. fi
  52. spool="lp $printer -t'$jobname' $spool"
  53. if test "$fil" = "" ; then
  54.     fil="-"
  55. fi
  56. dit="$ditroff -Tpsc -F$fontdir/$family $dopt $fil "
  57. psdit="$psdit -F$fontdir/$family"
  58.  
  59. if test "$nospool" = "1" ; then
  60.     $dit | $psdit
  61. else
  62.     $dit | $psdit | $spool
  63. fi
  64.